home *** CD-ROM | disk | FTP | other *** search
- Path: news1.cris.com!crawford
- From: crawford@kloognome.cris.com (Robert A. Crawford)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: Calling System Command in SUN C
- Date: 15 Mar 1996 22:25:11 GMT
- Organization: Concentric Internet Services
- Message-ID: <slrn4kjt4j.1h4.crawford@kloognome.cris.com>
- References: <4i1hlu$asm@ni1.ni.net> <4i41j0$8nu@dawn.mmm.com> <4i8uht$1po@abacus.abasoft.co.uk>
- NNTP-Posting-Host: cnc802136.concentric.net
- X-Newsreader: slrn (0.8.6.1)
-
- In article <4i8uht$1po@abacus.abasoft.co.uk>, David Byrne wrote:
- >In article <4i41j0$8nu@dawn.mmm.com>, Kevin J Hopps <kjhopps@mmm.com> wrote:
- >>The system(3S) function does what you want. You pass it a string
- >>which is the command to execute. It returns the exit status of
- >>the command.
- >Close - the exit status you want is in the 8 high-order bits of the return
- >value. On the Sun, you need to do something like
-
- [code snipped]
-
- Aren't the macros from sys/wait.h a more portable way to
- extract the exit status?
-
- --
- Robert Crawford crawford@iac.net http://www.iac.net/~crawford
-
- Heed the words of the dead, for they are the least likely to
- be trying to get something from you.
-
-